home *** CD-ROM | disk | FTP | other *** search
/ Master Visual Basic 3 / Master Visual Basic 3 (SAMS Publishing) (1994).ISO / mvprog / original / ch23 / spinit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-06-11  |  9.1 KB  |  302 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Earth and Moon around the Sun"
  6.    ClientHeight    =   5235
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1095
  9.    ClientWidth     =   7365
  10.    Height          =   5640
  11.    Icon            =   SPINIT.FRX:0000
  12.    Left            =   1035
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   5235
  16.    ScaleWidth      =   7365
  17.    Top             =   750
  18.    Width           =   7485
  19.    Begin CommandButton PlayButton 
  20.       Caption         =   "&Play"
  21.       Height          =   1095
  22.       Left            =   120
  23.       TabIndex        =   17
  24.       Top             =   2520
  25.       Width           =   1215
  26.    End
  27.    Begin PictureBox Picture2 
  28.       BackColor       =   &H00000000&
  29.       Height          =   4215
  30.       Left            =   1560
  31.       ScaleHeight     =   4185
  32.       ScaleWidth      =   4305
  33.       TabIndex        =   16
  34.       Top             =   240
  35.       Width           =   4335
  36.    End
  37.    Begin TEGOMM Tegomm1 
  38.       BorderStyle     =   0  'None
  39.       DeviceType      =   ""
  40.       FileName        =   ""
  41.       Height          =   495
  42.       Left            =   120
  43.       pcSpeed         =   100
  44.       pcTaskInterval  =   0
  45.       RecordMode      =   0  'Insert
  46.       Shareable       =   0   'False
  47.       Silent          =   0   'False
  48.       TabIndex        =   15
  49.       Tempo           =   0
  50.       Top             =   720
  51.       UpdateInterval  =   0
  52.       Width           =   1215
  53.    End
  54.    Begin PictureBox Picture1 
  55.       AutoSize        =   -1  'True
  56.       Height          =   4230
  57.       Index           =   13
  58.       Left            =   1560
  59.       Picture         =   SPINIT.FRX:0302
  60.       ScaleHeight     =   4200
  61.       ScaleWidth      =   4350
  62.       TabIndex        =   14
  63.       Top             =   240
  64.       Width           =   4380
  65.    End
  66.    Begin PictureBox Picture1 
  67.       AutoSize        =   -1  'True
  68.       Height          =   4230
  69.       Index           =   12
  70.       Left            =   1560
  71.       Picture         =   SPINIT.FRX:A55C
  72.       ScaleHeight     =   4200
  73.       ScaleWidth      =   4350
  74.       TabIndex        =   13
  75.       Top             =   240
  76.       Width           =   4380
  77.    End
  78.    Begin PictureBox Picture1 
  79.       AutoSize        =   -1  'True
  80.       Height          =   4230
  81.       Index           =   11
  82.       Left            =   1560
  83.       Picture         =   SPINIT.FRX:147B6
  84.       ScaleHeight     =   4200
  85.       ScaleWidth      =   4350
  86.       TabIndex        =   12
  87.       Top             =   240
  88.       Width           =   4380
  89.    End
  90.    Begin PictureBox Picture1 
  91.       AutoSize        =   -1  'True
  92.       Height          =   4230
  93.       Index           =   10
  94.       Left            =   1560
  95.       Picture         =   SPINIT.FRX:1EA10
  96.       ScaleHeight     =   4200
  97.       ScaleWidth      =   4350
  98.       TabIndex        =   11
  99.       Top             =   240
  100.       Width           =   4380
  101.    End
  102.    Begin PictureBox Picture1 
  103.       AutoSize        =   -1  'True
  104.       Height          =   4230
  105.       Index           =   9
  106.       Left            =   1560
  107.       Picture         =   SPINIT.FRX:28C6A
  108.       ScaleHeight     =   4200
  109.       ScaleWidth      =   4350
  110.       TabIndex        =   10
  111.       Top             =   240
  112.       Width           =   4380
  113.    End
  114.    Begin PictureBox Picture1 
  115.       AutoSize        =   -1  'True
  116.       Height          =   4230
  117.       Index           =   8
  118.       Left            =   1560
  119.       Picture         =   SPINIT.FRX:32EC4
  120.       ScaleHeight     =   4200
  121.       ScaleWidth      =   4350
  122.       TabIndex        =   9
  123.       Top             =   240
  124.       Width           =   4380
  125.    End
  126.    Begin PictureBox Picture1 
  127.       AutoSize        =   -1  'True
  128.       Height          =   4230
  129.       Index           =   7
  130.       Left            =   1560
  131.       Picture         =   SPINIT.FRX:3D11E
  132.       ScaleHeight     =   4200
  133.       ScaleWidth      =   4350
  134.       TabIndex        =   8
  135.       Top             =   240
  136.       Width           =   4380
  137.    End
  138.    Begin PictureBox Picture1 
  139.       AutoSize        =   -1  'True
  140.       Height          =   4230
  141.       Index           =   6
  142.       Left            =   1560
  143.       Picture         =   SPINIT.FRX:47378
  144.       ScaleHeight     =   4200
  145.       ScaleWidth      =   4350
  146.       TabIndex        =   7
  147.       Top             =   240
  148.       Width           =   4380
  149.    End
  150.    Begin PictureBox Picture1 
  151.       AutoSize        =   -1  'True
  152.       Height          =   4230
  153.       Index           =   5
  154.       Left            =   1560
  155.       Picture         =   SPINIT.FRX:515D2
  156.       ScaleHeight     =   4200
  157.       ScaleWidth      =   4350
  158.       TabIndex        =   6
  159.       Top             =   240
  160.       Width           =   4380
  161.    End
  162.    Begin PictureBox Picture1 
  163.       AutoSize        =   -1  'True
  164.       Height          =   4230
  165.       Index           =   4
  166.       Left            =   1560
  167.       Picture         =   SPINIT.FRX:5B82C
  168.       ScaleHeight     =   4200
  169.       ScaleWidth      =   4350
  170.       TabIndex        =   5
  171.       Top             =   240
  172.       Width           =   4380
  173.    End
  174.    Begin PictureBox Picture1 
  175.       AutoRedraw      =   -1  'True
  176.       AutoSize        =   -1  'True
  177.       Height          =   4230
  178.       Index           =   3
  179.       Left            =   1560
  180.       Picture         =   SPINIT.FRX:65A86
  181.       ScaleHeight     =   4200
  182.       ScaleWidth      =   4350
  183.       TabIndex        =   4
  184.       Top             =   240
  185.       Width           =   4380
  186.    End
  187.    Begin PictureBox Picture1 
  188.       AutoSize        =   -1  'True
  189.       Height          =   4230
  190.       Index           =   2
  191.       Left            =   1560
  192.       Picture         =   SPINIT.FRX:6FCE0
  193.       ScaleHeight     =   4200
  194.       ScaleWidth      =   4350
  195.       TabIndex        =   3
  196.       Top             =   240
  197.       Width           =   4380
  198.    End
  199.    Begin PictureBox Picture1 
  200.       AutoSize        =   -1  'True
  201.       Height          =   4230
  202.       Index           =   1
  203.       Left            =   1560
  204.       Picture         =   SPINIT.FRX:79F3A
  205.       ScaleHeight     =   4200
  206.       ScaleWidth      =   4350
  207.       TabIndex        =   2
  208.       Top             =   240
  209.       Width           =   4380
  210.    End
  211.    Begin PictureBox Picture1 
  212.       AutoSize        =   -1  'True
  213.       Height          =   4230
  214.       Index           =   0
  215.       Left            =   1560
  216.       Picture         =   SPINIT.FRX:84194
  217.       ScaleHeight     =   4200
  218.       ScaleWidth      =   4350
  219.       TabIndex        =   1
  220.       Top             =   240
  221.       Width           =   4380
  222.    End
  223.    Begin TextBox Text1 
  224.       Alignment       =   2  'Center
  225.       BackColor       =   &H00000000&
  226.       Enabled         =   0   'False
  227.       ForeColor       =   &H00FFFFFF&
  228.       Height          =   495
  229.       Left            =   2040
  230.       MultiLine       =   -1  'True
  231.       TabIndex        =   0
  232.       Top             =   4680
  233.       Width           =   4335
  234.    End
  235.    Begin SpinButton Spin1 
  236.       Delay           =   100
  237.       Height          =   495
  238.       Left            =   360
  239.       Top             =   4680
  240.       Width           =   1215
  241.    End
  242. Option Explicit
  243. Dim gCounter%
  244. Sub Form_Load ()
  245.     Dim i
  246.     ' Initialize the counter
  247.     gCounter = 1
  248.     Text1.Text = "Rotating at " + Str(gCounter) + " years per cycle."
  249.     ' Make all the pictures of Picture1() invisible.
  250.     For i = 0 To 13 Step 1
  251.         Picture1(i).Visible = False
  252.     Next i
  253.     ' Initialze the TegoMM multimedia control,
  254.     TegoMM1.Visible = False
  255.     TegoMM1.FileName = Left(App.Path, 2) + "\MVPROG\WAV\victo2m3.WAV"
  256.     TegoMM1.DeviceType = "WaveAudio"
  257.     TegoMM1.UpdateInterval = 260
  258.     TegoMM1.Command = "Open"
  259. End Sub
  260. Sub PlayButton_Click ()
  261.     If PlayButton.Caption = "Sto&p" Then
  262.        PlayButton.Caption = "&Play"
  263.        TegoMM1.Command = "Stop"
  264.     Else
  265.        PlayButton.Caption = "Sto&p"
  266.        TegoMM1.Command = "Play"
  267.     End If
  268. End Sub
  269. Sub Spin1_SpinDown ()
  270.     If gCounter > 1 Then
  271.        gCounter = gCounter - 1
  272.        Text1.Text = "Rotating at " + Str(gCounter) + " years per cycle."
  273.        TegoMM1.UpdateInterval = TegoMM1.UpdateInterval + 10
  274.     Else
  275.        Text1.Text = "Minimum speed reached!"
  276.     End If
  277. End Sub
  278. Sub Spin1_SpinUp ()
  279.     If gCounter < 25 Then
  280.        gCounter = gCounter + 1
  281.        Text1.Text = "Rotating at " + Str(gCounter) + " years per cycle."
  282.     TegoMM1.UpdateInterval = TegoMM1.UpdateInterval - 10
  283.     Else
  284.        Text1.Text = "Maximum speed reached!"
  285.     End If
  286. End Sub
  287. Sub Tegomm1_Done ()
  288.     If TegoMM1.Position = TegoMM1.Length Then
  289.        TegoMM1.Command = "Prev"
  290.        TegoMM1.Command = "Play"
  291.     End If
  292. End Sub
  293. Sub Tegomm1_StatusUpdate ()
  294.      Static FrameNumber%
  295.      
  296.      If PlayButton.Caption = "Sto&p" Then
  297.         FrameNumber = FrameNumber + 1
  298.         If FrameNumber = 14 Then FrameNumber = 0
  299.         Picture2.Picture = Picture1(FrameNumber).Picture
  300.      End If
  301. End Sub
  302.